package com.example.demo2.controller;

import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LoginController {

    @GetMapping("/hello")
    @ResponseBody
    public Object sayHello(@RequestParam(name="name",required = false,defaultValue = "world") String name, Model model) {
        System.out.println(name);
        return "Hello";
    }
}
